home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
dev
/
basic
/
Mildred.lha
/
lha
/
ZoomDemo.lha
/
ZoomTest.ascii
< prev
next >
Wrap
Text File
|
1999-03-27
|
2KB
|
79 lines
WBStartup
NoCli
DEFTYPE.l
.initgraphics
MBitmap 1,320,240
MBitmap 0,320*2,240*2
Mc2pWindow 0,320,240 ; Setup structures for c2p conversions.
InitBank 0,320*240,$10002 ; Get some free CHIP memory.
CludgeBitMap 0,320,240,8,Bank(0) ; And make it a planar bitmap.
LoadBitMap 0,"ZoomPic7.IFF",0 ; Get a pic
MPlanar16ToBitmap 0,Bank(0),320,240,320,240 ; Make it chunky
MBlockScroll 0,0,320,240,0,240
MBlockScroll 0,0,320,240*2,320,0
Dim scrtaglst.TagItem(7) ; All this stuff sets up our
scrtaglst(0)\ti_Tag = #SA_Left ; Taglist for the screen we
scrtaglst(0)\ti_Data = 0 ; want. As you can see, it's
scrtaglst(1)\ti_Tag = #SA_Depth ; rather non-standard.
scrtaglst(1)\ti_Data = 8 ; it doesn't have to be, it's
scrtaglst(2)\ti_Tag = #SA_Width ; just that this routine needs
scrtaglst(2)\ti_Data = 320 ; a larger screen to avoid
scrtaglst(3)\ti_Tag = #SA_Height ; clipping.
scrtaglst(3)\ti_Data = 240
scrtaglst(4)\ti_Tag = #SA_BitMap
scrtaglst(4)\ti_Data = Addr BitMap (0)
scrtaglst(5)\ti_Tag = #SA_ShowTitle
scrtaglst(5)\ti_Data = 0
scrtaglst(6)\ti_Tag = #SA_Draggable
scrtaglst(6)\ti_Data = 0
scrtaglst(7)\ti_Tag = #TAG_END ; The most important tag of them all.
ScreenTags 0,"MildredDEMO",&scrtaglst(0) ; Open our intuition screen.
ShowPalette 0 ; Attach our palette to the screen.
MUseBitmap 1 ; Tell Mildred to use our main
; chunky buffer (just in case)
mag.q=1
its.l=0
magdirection.q=1.5
ResetTimer
Repeat ; Repeat our mainloop ....
If mag+magdirection>240*2 OR mag+magdirection<1 Then magdirection=-magdirection
mag+magdirection
SourceX.q=0
SourceY.q=0
OpWidth.w=320
OpHeight.w=240
SourceXAdder.q=mag/240
SourceYAdder.q=mag/240
DestX.w=0
DestY.w=0
MZoom SourceX,SourceY,SourceXAdder,SourceYAdder,DestX,DestY,OpWidth,OpHeight,False,0
Mc2p Bank(0) ; Convert our chunky buffer to
its+1
Until Joyb(0)<>0 OR Joyb(1)<>0 OR RawStatus($45)
t=Timer
t=Max(t,1)
its=Max(its,1)
a.q=50.0/(t/its)
WbToScreen 1
Window 2,16,16,400,60,0,"Test results",1,0
WindowOutput 2
NPrint a," frames per second"
NPrint " "
NPrint "Press mouse/joy button..."
VWait 20
Repeat
Until Joyb(0)<>0 OR Joyb(1)<>0 OR RawStatus($45)